package com.ihighest.app.infox.activity;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;
import android.widget.TextView;

import com.ihighest.app.common.core.Application;
import com.ihighest.app.infox.R;
import com.ihighest.app.infox.fragment.NearStoresListFragment;
import com.ihighest.app.infox.myview.ActivityTitle;

/**
 * TODO (类名称)
 * NearAriculturalStoresActivity
 * <pre>
 * Description: TODO (描述类的主要功能)
 * 附近农资店界面
 * </pre>
 * 
 * <pre>
 * Example: TODO (描述类的的主要用法) (可选)
 * </pre>
 *
 * @author yyh Created at 2015-10-13 上午11:02:01
 * @version 1.0
 */
public class NearAriculturalStoresActivity extends FragmentActivity implements
		OnClickListener {
	private ActivityTitle title;

	TextView listTextView, mapTextView;
	ListView near_storesListview;

	private NearStoresListFragment nearStoresListFragment;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		Application.getInstance().addActivity(this);
		setContentView(R.layout.infox_near_the_agricultural_stores);

		title = (ActivityTitle) findViewById(R.id.id_near_agricultural_stores);
		// title.setTitle("金草帽");
		title.setViewVersible(title.titleBack);
		title.setViewGone( title.titleSetting,
				title.titleOther, title.rightLayout, title.titleRefresh,
				title.titleMsg,title.top_title_text);
		inint();
	}

	private void inint() {
		// TODO Auto-generated method stub
		listTextView = (TextView) findViewById(R.id.id_list_textview);
		mapTextView = (TextView) findViewById(R.id.id_map_textview);
		near_storesListview = (ListView) findViewById(R.id.id_near_agricultural_stores_listview);
		listTextView.setOnClickListener(this);
		mapTextView.setOnClickListener(this);
		nearStoresListFragment=new NearStoresListFragment(this);
		getSupportFragmentManager().beginTransaction().add(R.id.id_fragmentlayout, nearStoresListFragment).commit();
		
	}

	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		switch (arg0.getId()) {
		case R.id.id_list_textview:
			//隐藏地图

			break;
		case R.id.id_map_textview:
			
			//隐藏listfragment
			//替换地图fragment；

			break;

		}
	}
}
